﻿<%@ Page Title="Trang chủ - MailBox" EnableEventValidation="false" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MailBox._Default" %>


<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">

    <asp:UpdatePanel runat="server" ID="upEmailList">
        <ContentTemplate>
            <div style="text-align: center;">
                <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upEmailList" DynamicLayout="true">
                    <ProgressTemplate>
                        <img src="images/loading.gif">
                    </ProgressTemplate>
                </asp:UpdateProgress>

            </div>
            <div id="menu_top" class="col-md-12 col-xs-12" style="padding: 0px; border-bottom: 1px solid #ddd;">
                <div style="padding: 10px 10px 10px 0px; width: auto; float: left;">
                    <button runat="server" id="btnSeleteAll" onserverclick="btnSeleteAll_ServerClick" class="btn btn-default" style="border-radius: 0px; width: 100%;" data-toggle="tooltip" data-placement="bottom" title="Chọn tất cả mails hiện hành">
                        <span class="fa fa-check-square-o"></span>
                    </button>
                </div>
                <div style="padding: 10px 10px 10px 0px; width: auto; float: left;">
                    <button runat="server" onserverclick="btnRefresh_Click" class="btn btn-default" style="border-radius: 0px; width: 100%;" data-toggle="tooltip" data-placement="bottom" title="Làm mới mails hiện hành">
                        <span class="fa fa-refresh"></span>
                    </button>
                </div>
                <div style="padding: 10px 10px 10px 0px; width: auto; float: left;">
                    <button runat="server" id="btnDelete" onserverclick="btnDelete_ServerClick" class="btn btn-default" style="border-radius: 0px; width: 100%;" data-toggle="tooltip" data-placement="bottom" title="Xóa nội dung">
                        <span class="fa fa-trash-o"></span>
                    </button>
                </div>
                <%--                <div class="visible-xs pull-right" style="padding: 10px 10px 10px 0px; width: auto; float: left;">
                    <button onclick="ShowProgress();" runat="server" id="btnPre" onserverclick="btnPre_ServerClick" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Cũ hơn" style="border-radius: 0px;">
                        <i class="fa fa-caret-right"></i>
                    </button>
                </div>
                <div class="visible-xs pull-right" style="padding: 10px 10px 10px 0px; width: auto; float: left;">
                    <button onclick="ShowProgress();" runat="server" id="btnNext" onserverclick="btnNext_ServerClick" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Mới hơn" style="border-radius: 0px; margin-right: 10px;">
                        <i class="fa fa-caret-left"></i>
                    </button>
                </div>--%>
                <div style="padding: 10px 10px 10px 0px; width: auto; float: right;">
                    <asp:Label runat="server" ID="lblPaging" Style="margin-right: 20px; font-size: 13px;"></asp:Label>
                    <button runat="server" id="btnPre" onserverclick="btnPre_ServerClick" class="btn btn-default hidden-xs" data-toggle="tooltip" data-placement="bottom" title="Cũ hơn" style="border-radius: 0px;">
                        <i class="fa fa-caret-left"></i>
                    </button>
                    <button runat="server" id="btnNext" onserverclick="btnNext_ServerClick" class="btn btn-default hidden-xs" data-toggle="tooltip" data-placement="bottom" title="Mới hơn" style="border-radius: 0px; margin-right: 20px;">
                        <i class="fa fa-caret-right"></i>
                    </button>
                </div>
            </div>
            <asp:HiddenField runat="server" ID="hdfMaxID" />
            <asp:HiddenField runat="server" ID="hdfMinID" />
            <asp:HiddenField runat="server" ID="hdfCurrentPage" />
            <asp:HiddenField runat="server" ID="hdfCurrentID" />
            <!-- Danh sách mail -->
            <div class="col-md-12 col-xs-12" style="padding: 0px;">
                <div class="table-responsive" id="table_default" style="padding-bottom: 8px;">
                    <table class="table table-hover" style="margin: 10px 0px;border:0px;">
                        <tbody>
                            <asp:Repeater runat="server" ID="rptMail">
                                <ItemTemplate>
                                    <tr style='<%# (!Convert.ToBoolean(Eval("IsOpen"))&&Eval("mode")+""=="Inbox"?"background: #fafafa; font-weight: bold; cursor: pointer;": "background:none;cursor:pointer;")%>'>
                                        <td style="text-align: center;width:40px;">
                                            <asp:CheckBox runat="server"  />
                                            <asp:HiddenField runat="server" Value='<%#Eval("id") %>' />
                                        </td>
                                        <td style="width:250px;white-space: nowrap;overflow:hidden !important;text-overflow: ellipsis;" title='<%#Eval("InboxObject") %>' onclick="ShowProgress();window.open('Details.aspx?id=<%#Eval("id") %>&mode=<%#Eval("mode") %>','_self');"><%#this.Left(Eval("InboxObject")+"",40) %>
                                        </td>
                                        <td style="max-width:500px;white-space: nowrap;overflow:hidden !important;text-overflow: ellipsis;" onclick="ShowProgress();window.open('Details.aspx?id=<%#Eval("id") %>&mode=<%#Eval("mode") %>','_self');"><%#Eval("Subject") %>  - <label style="color:#808080; font-style: italic;font-size:12px;"><%#this.Left(Eval("body").ToString(),50) %></label>
                                        </td>
                                        <%--<td onclick="ShowProgress();window.open('Details.aspx?id=<%#Eval("id") %>','_self');" style="overflow: hidden;"><%#Eval("body") %>....
                                </td>--%>
                                        <td style="width: 30px; text-align: right;" onclick="ShowProgress();window.open('Details.aspx?id=<%#Eval("id") %>&mode=<%#Eval("mode") %>','_self');">
                                            <%--File đính kèm--%>
                                            <i class="fa fa-file" style='visibility: <%#(Eval("hasAttach")+""=="1"?"visible":"hidden") %>'></i>
                                        </td>
                                        <td style="width: 110px" onclick="ShowProgress();window.open('Details.aspx?id=<%#Eval("id") %>&mode=<%#Eval("mode") %>','_self');"><%#Convert.ToDateTime(Eval("createtime")).ToString("HH:mm - dd/MM") %>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Repeater runat="server" ID="rptDraft">
                                <ItemTemplate>
                                    <tr style='<%# (!Convert.ToBoolean(Eval("IsOpen"))&&Eval("mode")+""=="Inbox"?"background: #fafafa; font-weight: bold; cursor: pointer;": "background:none;cursor:pointer;")%>'>
                                        <td style="text-align: center;width:40px;">
                                            <asp:CheckBox runat="server"  />
                                            <asp:HiddenField runat="server" Value='<%#Eval("id") %>' />
                                        </td>
                                        <td style="width:250px;white-space: nowrap;overflow:hidden !important;text-overflow: ellipsis;" title='<%#Eval("InboxObject") %>' onclick="ShowProgress();window.open('Details.aspx?id=<%#Eval("id") %>&mode=<%#Eval("mode") %>','_self');"><%#Eval("InboxObject") %>
                                        </td>
                                        <td style="max-width:500px;white-space: nowrap;overflow:hidden !important;text-overflow: ellipsis;" onclick="ShowProgress();window.open('Details.aspx?id=<%#Eval("id") %>&mode=<%#Eval("mode") %>','_self');"><%#Eval("Subject") %>  - <label style="color:#808080; font-style: italic;font-size:12px;"><%#this.Left(Eval("body").ToString(),50) %></label>
                                        </td>
                                        <%--<td onclick="ShowProgress();window.open('Details.aspx?id=<%#Eval("id") %>','_self');" style="overflow: hidden;"><%#Eval("body") %>....
                                </td>--%>
                                        <td style="width: 30px; text-align: right;" onclick="ShowProgress();window.open('Details.aspx?id=<%#Eval("id") %>&mode=<%#Eval("mode") %>','_self');">
                                            <%--File đính kèm--%>
                                            <i class="fa fa-file" style='visibility: <%#(Eval("hasAttach")+""=="1"?"visible":"hidden") %>'></i>
                                        </td>
                                        <td style="width: 110px" onclick="ShowProgress();window.open('Details.aspx?id=<%#Eval("id") %>&mode=<%#Eval("mode") %>','_self');"><%#Convert.ToDateTime(Eval("createtime")).ToString("HH:mm - dd/MM") %>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </tbody>
                    </table>
                </div>
            </div>

        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content runat="server" ContentPlaceHolderID="SmartPhoneLeft">
    <div class="col-xs-12" style="width: 100%; padding: 5px 0px; text-align: center;">
        <div class="col-xs-12" style="padding: 5px 0px; text-align: center;">

            <div class="col-xs-3" style="padding: 5px; text-align: right;">
                <img class="img-circle img img-thumbnail dropdown-toggle" data-toggle="dropdown" src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpf1/t1.0-1/c6.0.160.160/p160x160/10450596_545002008956679_2387905694320684413_n.jpg" style="width: 100%;" />
                <div class="dropdown-menu" style="width: 300px; left: 0px !important; padding: 10px;">
                    <div class="col-xs-12" style="padding: 0px;">
                        <div class="col-xs-4" style="padding: 0px;">
                            <img class="img" src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpf1/t1.0-1/c6.0.160.160/p160x160/10450596_545002008956679_2387905694320684413_n.jpg" style="width: 100%;" />
                        </div>
                        <div class="col-xs-8" style="padding: 4px 20px;">
                            <p style="font-size: 16px;">
                                <b style="font-size: 14px;">Yas Jek</b><br />
                                yas.jek@gmail.com
                            </p>
                            <p style="margin: 0px;">
                                <span class="btn btn-default" style="width: 100%; height: 34px; border-radius: 0px;" onclick="ShowProgress();window.open('Profile.aspx','_self');">Thông tin</span>
                            </p>
                        </div>
                    </div>
                    <div class="col-xs-12" style="padding: 0px;">
                        <div class="col-xs-6" style="padding: 7px 5px 0px 0px; line-height: 34px;">
                            <span class="btn btn-default" style="width: 100%; height: 34px; border-radius: 0px;" onclick="ShowProgress();window.open('Setting.aspx','_self');">Cài đặt</span>
                        </div>
                        <div class="col-xs-6" style="padding: 7px 0px 0px 5px; line-height: 34px;">
                            <span class="btn btn-default" style="width: 100%; height: 34px; border-radius: 0px;" onclick="ShowProgress();window.open('Logout.aspx','_self');">Đăng xuất</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-7" style="padding: 5px;">
                <div class="col-xs-12" style="padding: 0px; font-weight: bold; text-align: center;">
                    <span class="visible-xs noprint" style="line-height: 26px; color: #555;">bthehien@gmail.com</span>
                </div>
            </div>
            <div class="col-xs-2" style="padding: 0px;">
                <span class="menu-anchor visible-xs pull-right noprint" style="border: 1px solid #ddd; margin: 10px;"></span>
            </div>
        </div>
    </div>
    <hr />
    <div class="col-xs-12 menu_left" style="padding: 0px;">
        <ul>
            <li class="active"><a href="default.aspx">Hộp thư đến (2)</a></li>
            <li><a href="#">Thư đã gửi</a></li>
            <li><a href="#">Hộp thư Spam</a></li>
            <li><a href="#">Thư nháp</a></li>
            <li><a href="#">Thùng rác</a></li>
        </ul>
    </div>
</asp:Content>
